#ifndef PARSER_H
#define PARSER_H

#include <QList>
#include "namespace.h"

class Template;
class Var;
class UserFunction;
class Component;
class QOptions;

class Parser : public Namespace
{
public:
    Parser(const QOptions& options);

    Node* getEntry( const QString& name );

    QList<Template*> templates() const;    
    Template* mainTemplate();

    QList<Var*> variables() const;
    QList<UserFunction*> userFunctions() const;
    QList<Component*> components() const;

    static Parser* self() { Q_ASSERT(s_parser); return s_parser; }

private:
    static Parser* s_parser;
};

#endif // PARSER_H
